/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import request from '@/utils/request';

export async function cdFinanceAccount(params: any) {
  return request('/FianceTransfer/cdFinanceAccount', {
    method: 'POST',
    data: params,
  });
}

export async function cdFinanceOperateAccount(params: any) {
  return request('/FianceTransfer/cdFinanceOperateAccount', {
    method: 'POST',
    data: params,
  });
}

export async function handQuery(params: any) {
  return request('/FianceTransfer/handQuery', {
    method: 'POST',
    data: params,
  });
}

export async function cdOperateReasonList(params: any) {
  return request('/FianceTransfer/cdOperateReasonList', {
    method: 'POST',
    data: params,
  }).then(({ data }) => {
    return data || {};
  });
}

let userTypeMap: any = null;
export async function getUserTypeMap() {
  if (userTypeMap) {
    return userTypeMap;
  }
  return request('/FianceTransfer/userTypeMap', {
    method: 'POST',
  }).then(({ data }) => {
    userTypeMap = data;
    return userTypeMap || {};
  });
}
